package RTL.Task3;

//将流量和通话套餐的共同行为总结

public abstract class Package {
    // 月费
    private double rate;

    public Package() {
    }

    public Package(double rate) {
        setRate(rate);
    }

    // get和set，并提示月费
    public double getRate() {
        return rate;
    }

    public void setRate(double rate) {
        if (rate >= 0) {
            this.rate = rate;
        } else {
            System.out.println("您已欠费，请立刻充钱");
        }
    }

    // 4.提供显示所有套餐信息的抽象方法
    public abstract void show();
}
